package com.share.design.command.demo01;

/**
 * @author caifan
 * @since 2022/11/7
 */
public class Client {

    public static void main(String[] args) {
        Editor markdownEditor = new MarkdownEditor();
        Command openCommand = new OpenCommand(markdownEditor);
        Command saveCommand = new SaveCommand(markdownEditor);
        Command closeCommand = new CloseCommand(markdownEditor);

        Editor javaEditor = new MarkdownEditor();
        Command openCommand1 = new OpenCommand(javaEditor);
        Command saveCommand1 = new SaveCommand(javaEditor);
        Command closeCommand1 = new CloseCommand(javaEditor);

        WebEditFlow webEditFlow = new WebEditFlow();
        webEditFlow.setCommand(openCommand);
        webEditFlow.setCommand(saveCommand);
        webEditFlow.setCommand(closeCommand);

        webEditFlow.setCommand(openCommand1);
        webEditFlow.setCommand(saveCommand1);
        webEditFlow.setCommand(closeCommand1);

        webEditFlow.run();
    }
}
